package com.lzj.server.entity.video;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lzj.server.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serial;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_message")
@Schema(name = "SysMessage", description = "消息表，存储系统或用户消息内容")
public class Message extends BaseEntity {

    @Serial
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "主键，自增ID")
    private Long id;

    @TableField("user_id")
    @Schema(description = "接收消息的用户ID")
    private Long userId;

    @TableField("message_type")
    @Schema(description = "消息类型，如 SYSTEM（系统消息）、NOTICE（通知）、CHAT（聊天）等")
    private String messageType;

    @TableField("title")
    @Schema(description = "消息标题")
    private String title;

    @TableField("content")
    @Schema(description = "消息内容")
    private String content;

    @TableField("obj_type")
    @Schema(description = "关联对象类型，如 video 等")
    private String objType;

    @TableField("obj_id")
    @Schema(description = "关联对象ID，如视频ID、帖子ID等")
    private Long objId;

    @TableField("is_read")
    @Schema(description = "是否已读，0-未读，1-已读")
    private Integer isRead;

}
